<!-- app/templates/base.html -->
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>组会知识库</title>
    <!-- Bootstrap 5 CDN -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- 自定义样式：统一标题字体（黑体）与表格/表单美化 -->
    <link rel="stylesheet" href="/static/styles.css">
    <style>
        body { font-family: Arial, Helvetica, sans-serif; }
        .main-container { min-height: 80vh; }
        .card-pretty { box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
        /* 首页按钮区域样式，简约美观，响应式 */
        .hero-buttons { padding: 24px 0; }
        .hero-card { border: 1px solid rgba(0,0,0,0.04); transition: transform .12s ease, box-shadow .12s ease; }
        .hero-card:hover { transform: translateY(-6px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
        .hero-btn { min-height: 96px; display:flex; align-items:center; justify-content:center; text-align:center; flex-direction:column; }
    </style>
</head>
<body>
    <nav class="navbar navbar-expand-lg navbar-light bg-light">
        <div class="container">
            <a class="navbar-brand" href="/">组会知识库</a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navMenu">
                <span class="navbar-toggler-icon"></span>
            </button>

            <div class="collapse navbar-collapse" id="navMenu">
                <ul class="navbar-nav ms-auto">
                    {% if user %}
                        <li class="nav-item"><a class="nav-link" href="/">首页</a></li>
                              <!-- 新增聊天入口 -->
                        {% include "chat_sdk.html" %}
                        <li class="nav-item"><a class="nav-link text-danger" href="/logout">退出</a></li>
                        <li class="nav-item nav-link">欢迎, <strong>{{ user.username }}</strong></li>
                    {% else %}
                        <li class="nav-item"><a class="nav-link" href="/login">登录</a></li>
                        <li class="nav-item"><a class="nav-link" href="/register">注册</a></li>
                    {% endif %}
                </ul>
            </div>
        </div>
    </nav>

    <div class="container main-container py-4">
        <div class="row justify-content-center">
            <div class="col-12 col-md-10">
                <!-- 全局消息显示（从 session 中读取一次性消息） -->
                {% if request.session.get('message') %}
                    <div class="alert alert-success">{{ request.session.pop('message') }}</div>
                {% endif %}
                {% if request.session.get('error') %}
                    <div class="alert alert-danger">{{ request.session.pop('error') }}</div>
                {% endif %}

                {% block content %}{% endblock %}
            </div>
        </div>
    </div>

    <footer class="text-center text-muted py-3">
        <small>© 组会知识库</small>
    </footer>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
